package com.zhuiyun.educations.api.fileprice.mapper;

import com.zhuiyun.educations.api.fileprice.entity.FilePrice;
import com.zhuiyun.educations.api.uploadFile.entity.FileManage;
import com.zhuiyun.educations.common.mapper.BaseMapper;
import com.zhuiyun.educations.util.pageUtil.PageRequest;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @ClassName CoursePriceMapper
 * @Description TODO 课程价钱管理
 * @Author ys
 * @Date 2023/6/19 19:28
 **/
public interface FilePriceMapper extends BaseMapper<FilePrice> {
    /**
     * @Author ys
     * @Description TODO 分页查询
     * @Date 2023/6/26 14:09
     * @Return CommonResult
     * @param
     */
    @Select("SELECT * FROM file_price f LEFT JOIN file_manage m ON f.file_id = m.id where f.del_flag=0")
    List<FilePrice> getFilePrice(PageRequest pageRequest);
    /**
     * @Author ys
     * @Description TODO 逻辑删除
     * @Date 2023/6/26 14:09
     * @Return CommonResult
     * @param
     */
    @Update("update file_price set del_flag=1 where id=#{id}")
    int deleteFilePriceById(int id);
    /**
     * @Author ys
     * @Description TODO 资料下拉
     * @Date 2023/6/26 14:09
     * @Return CommonResult
     * @param
     */
    @Select("SELECT * FROM  file_manage ")
    List<FileManage> fileSelect();
}
